@extends('new.layouts.indexPublic')
@section('title'){{ '校园招聘|最新招聘信息'.Site::get('webname') }} @endsection
{{--首页css--}}
@section('headcss')
    <meta name="keywords" content="{{Site::get('homekeywords')}}">
    <meta name="description" content="{{Site::get('homedescription')}}">
    @parent
    <link rel="stylesheet" href="{{asset('/new/css/index/campusRecruit.css')}}">
@endsection
{{--主体内容--}}
@section('content')
    {{--logo、搜索栏--}}
    @include('new.layouts.logoAndSearch')
    {{--logo、搜索栏结束--}}

    {{--主导航--}}
    @include('new.layouts.mainNav')
    {{--主导航结束--}}

    {{--主体内容--}}
    <div class="main">
        {{--bannaer--}}
        <div class="banner"></div>
        {{--end bannaer--}}
        <div class="wrapper">
            {{--热门校招--}}
            <div class="hotRecruit">
                <h2><span>热门校招</span></h2>
                <ul>
                    @if(count($jobList) > 0)
                        @foreach($jobList as $k=> $v)
                            <li @if($k % 2 != 0) class="noMarginRight" @endif>
                                <p class="p1">
                                    <a class="title" href="{{$v->joburl}}" target="_blank">{{str_limit($v->job_title,25)}}</a>
                                    <span>{{$v->updatetime}}</span>
                                </p>
                                <p class="p2">
                                    <span class="salary">{{$v->money}}</span>
                                    <span class="address">{{str_limit($v->location1,6)}}</span>
                                </p>
                                <p class="p3"><a href="javascript:void(0)" target="_blank">{{$v->company_name}}</a></p>
                            </li>
                        @endforeach
                    @else
                        <li class="noJobs"><span>对不起，暂时没有找到热门校招信息...</span></li>
                    @endif
                </ul>
            </div>
            {{--热门校招结束--}}

            {{--名企招聘--}}
            <div class="famousCompany">
                <h2><span>名企招聘</span></h2>
                <ul>
                    @if(count($campusX1) > 0)
                        @foreach($campusX1 as $k=> $v)
                            <li>
                                <a href="{{$v->ad_url}}" target="_blank">
                                    <img src="{{$v->pic_url}}" alt="{{$v->title}}" width="192" height="100">
                                    <span>{{$v->title}}</span>
                                </a>
                            </li>
                        @endforeach
                    @endif
                    @if(count($campusX2) > 0)
                        @foreach($campusX2 as $k=> $v)
                            @if($k < 4)
                                <li>
                                    <a href="{{$v->ad_url}}" target="_blank">
                                        <img src="{{$v->pic_url}}" alt="{{$v->title}}" width="192" height="100">
                                        <span>{{$v->title}}</span>
                                    </a>
                                </li>
                            @endif
                        @endforeach
                    @endif
                    @if(count($campusX1) < 0 && count($campusX2) < 0)
                        <li class="noJobs">你还没添加名企招聘广告...</li>
                    @endif
                </ul>
            </div>
            {{--名企招聘结束--}}

            {{--最新实习岗位--}}
            <div class="internships">
                <h2><span>最新实习岗位</span><a href="{{url('job?part_status=2')}}" target="_blank">更多></a></h2>
                <ul>
                    @if(count($jobList) > 0)
                        @foreach($jobList as $k=> $v)
                            @if($k < 9 )
                                <li @if($k%3 == 0) class="noMarginLeft" @endif>
                                    <a href="{{url($v->joburl)}}" target="_blank">
                                        <p class="job_title">{{str_limit($v->job_title,24)}}
                                            <span>{{str_limit($v->location1)}}</span></p>
                                        <p>{{str_limit($v->company_name,32)}}</p>
                                    </a>
                                </li>
                            @endif
                        @endforeach
                    @else
                        <li class="noJobs">对不起，暂时没有实习岗位信息...</li>
                    @endif
                </ul>
            </div>
            {{--最新实习岗位结束--}}

            {{--校园招聘会--}}
            <div class="recruitment">
                <h2><span>校园招聘会</span><a href="{{url('job?part_status=2')}}" target="_blank">更多></a></h2>
                    <ul class="lists">
                        @if(count($recruitment) > 0)
                            @foreach($recruitment as $k=>$v)
                                <li class=" @if($v->hold_time >= date('Y-m-d',time())) booked @endif">
                                    <a href="{{url('job_fair_'.$v->id.'.html')}}" target="_blank">
                                        <div class="leftTime">
                                            <span class="date">{{$v->hold_date}}</span>
                                            <span class="week">{{$v->week}}</span>
                                        </div>
                                        <dl>
                                            <dt>{{$v->job_title,44}}</dt>
                                            <dd>举办院校：{{$v->hold_unit,44}}</dd>
                                            <dd>举办地点：{{$v->hold_address,44}}</dd>
                                        </dl>
                                    </a>
                                </li>
                            @endforeach
                        @else
                            <li class="noList">您还没有添加招聘会信息...</li>
                        @endif
                    </ul>
                {{--合作院校--}}
                <ul class="cooperate">
                    @if(count($campusX3) > 0)
                        @foreach($campusX3 as $k=> $v)
                            <li>
                                <a href="{{$v->ad_url}}" target="_blank">
                                    <img src="{{$v->pic_url}}" alt="{{$v->title}}" width="136" height="50">
                                </a>
                            </li>
                        @endforeach
                    @else
                        <li class="noAdv">您还没添加合作院校广告...</li>
                    @endif
                </ul>
                {{--合作院校结束--}}
            </div>
            {{--校园招聘会结束--}}
        </div>
    </div>
    {{--主体内容结束--}}
@endsection
{{--首页js--}}
@section('js')
    @parent
    <script type="text/javascript" src="{{Resources::jsProvinceArea()}}"></script>
    <script type="text/javascript">
    $(function(){
        //名企招聘绑定图片切换事件
        $('.famousCompany ul li').find('a').each(function(index){
            var oitem = $(this).find('span');
            movement($(this),200,oitem);

            //图片切换事件
            function movement(othis,otime,oitem){
                othis.bind("mouseenter mouseleave",function(e) {
                    var w = $(this).width();
                    var h = $(this).height();
                    var x = (e.pageX - this.offsetLeft - (w / 2)) * (w > h ? (h / w) : 1);
                    var y = (e.pageY - this.offsetTop - (h / 2)) * (h > w ? (w / h) : 1);
                    //direction的值为“0,1,2,3”分别对应着“上，右，下，左”
                    var direction = Math.round((((Math.atan2(y, x) * (180 / Math.PI)) + 180) / 90) + 3) % 4;
                    if(e.type == 'mouseenter'){
                        switch(direction){
                            case 0 : oitem.css({'left':'0', 'top':'-100%' }); break;
                            case 1 : oitem.css({'left':'100%', 'top':'0' }); break;
                            case 2 : oitem.css({'left':'0', 'top':'100%' }); break;
                            case 3 : oitem.css({'left':'-100%', 'top':'0' }); break;
                        }
                        oitem.stop().animate({'left':'0', 'top':'0' },otime);
                    }else{
                        switch(direction){
                            case 0 : oitem.stop().animate({'left':'0', 'top':'-100%' },otime); break;
                            case 1 : oitem.stop().animate({'left':'100%', 'top':'0' },otime); break;
                            case 2 : oitem.stop().animate({'left':'0', 'top':'100%' },otime); break;
                            case 3 : oitem.stop().animate({'left':'-100%', 'top':'0' },otime); break;
                        }
                    }
                });
            }
        });
    });
    </script>
@endsection